<script>
    $(function () {
        $('#form_id').validationEngine();
        $("input[name*='Time']").datepicker({dateFormat:'yy-mm-dd'});

        $("#detail_add").click(function () {
            $('#order_add').hide();
            $('#bgDiv').hide();
        })
    });
</script>
<style>
    .lf {
        padding: 5px;
        width: 250px;
        float: left;
    }

    .lf span {
        width: 60px;
    }
</style>
<div style="float:left">
    <h3 id="comments-title"><em>商品信息</em></h3>
</div>
<a href="#" style="float:right;line-height:20px;padding:10px;" class="link_close"
   onclick=" $('#order_add').hide();   $('#bgDiv').hide();  return false;"></a>
</div>
<div class="clear"></div>
<div class="comment-form">
    <div>
        <table align="center" class="">
            <tr>
                <th>商品编号</th>
                <th style="width:158px">商品图片</th>
                <th>数量</th>
                <th>单价</th>
                <th>客户信息</th>
            </tr>
            <tbody>
            <?php
            foreach ($detail as $k => $v):
                ?>
            <tr class="tr_center">
                <td>
                    <?php
                    echo $v['commodityNumber'];
                    ?>
                </td>
                <td>
                    <div style='border:1px solid #ffecf1;padding:3px;background-color:#efefef'>
                        <?php echo "<img src='" . $v['imagePath'] . "' width='150px' height='150px' />" ?>
                    </div>
                </td>
                <td>
                    <?php
                    echo $v['amount'];
                    ?>
                </td>
                <td>
                    <?php
                    echo $v['unitPrice'];
                    ?>
                </td>
                <td>
                    <?php
                    echo $v['clientInfo'];
                    ?>
                </td>
            </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
        <center>
        </center>
    </div>
</div>
<h3 id="comments-titles"><em>修改发货信息</em></h3>
<div class="comment-form" style="padding:10px 30px;">
    <div>
        <?php
        echo form_open("order/wait_for_delivery_alter_save/" . $num, array('id' => 'form_id'));
        ?>
        <?php foreach ($delivery as $k => $v): ?>
        <input type="hidden" id="product_id" name="id" value="<?php echo $v['id']?>"/>
        <div class='lf'>
            <span>发货日期</span>
            <input type="text" name="deliveryTime" value="<?php echo  $v['deliveryTime']?>"
                   id="deliveryTime" size="20" class="validate[required,custom[date]]"/>
        </div>
        <div class='lf'>
            <span>快递单号</span>
            <input type="text" name="expressNumber" value="<?php echo  $v['expressNumber']?>" id="expressNumber"
                   size="20" class="validate[required]/">
        </div>

        <div class='lf' style="width:180px;">
            <span>运输方式</span>
            <select name="expressMethod">
                <option value="汽车" <?php if ($v['expressMethod'] == "汽车") echo "selected='selected'"?> >汽车</option>
                <option value="火车" <?php if ($v['expressMethod'] == "火车") echo "selected='selected'"?> >火车</option>
                <option value="飞机" <?php if ($v['expressMethod'] == "飞机") echo "selected='selected'"?> >飞机</option>
            </select>
        </div>
        <div class='lf'>
            <span>实际运费</span>
            <input type="text" name="actualFreight" value="<?php echo $v['actualFreight']?>" id="actualFreight"
                   size="10" class="validate[required,custom[number]]">
        </div>
        <div class='lf'>
            <span>重量</span>
            <input type="text" name="weight" value="<?php echo  $v['weight']?>" id="weight" size="10"
                   class="validate[required,custom[number]]"/>
        </div>
        <div class='clear'></div>
        <div class="lf" style="width:350px;">
            <div>快递备注</div>
            <textarea name="expressComment" id="expressComment" rows="5"
                      cols="50"><?php echo $v['expressComment']?></textarea>
        </div>
        <div class="lf" style="width:350px;">
            <div>客户备注</div>
            <textarea name="clientComment" id="clientComment" rows="5"
                      cols="50"><?php echo $v['clientComment']?></textarea>
        </div>
        <div class='clear'></div>
        <?php endforeach; ?>
        <center>
            <?php
            $data = array('name' => 'mysubmit', 'value' => '保存', 'class' => 'confirm');
            echo form_submit($data);
            ?>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" id="detail_add" class="confirm" value="关闭"/>
        </center>
        <?php
        echo form_close();
        ?>
    </div>
</div>